/*
 * NodeControl.java
 *
 * Created on 03 January 2004, 02:54
 * Copyright (C) 2004, Velocityme Partnership
 */

package com.velocityme.client.gui.node.systemnode;

import com.velocityme.client.gui.ChangeDeltaPanel;
import com.velocityme.client.gui.exception.ExceptionWindow;
import com.velocityme.client.utility.StatelessRemoteClientSessionUtil;
import com.velocityme.interfaces.KeySession;
import com.velocityme.interfaces.NodePK;
import com.velocityme.utility.InvalidKeyException;
import com.velocityme.utility.PermissionDeniedException;
import com.velocityme.valueobjects.NodeValue;
import java.rmi.RemoteException;
import java.util.Set;
import javax.ejb.CreateException;
import javax.naming.NamingException;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;

/**
 *
 * @author  Robert Crida Work
 */
public class SystemNodeControl extends javax.swing.JPanel {
    
    private KeySession m_key;
    private SystemNodeValueDisplay m_systemNodeValueDisplay;
    
    /** Creates new form NodeControl */
    public SystemNodeControl(KeySession p_key, NodePK p_nodePK) {
        initComponents();
        m_key = p_key;
        try {
            jTabbedPane1.addTab("Change Log", new ChangeDeltaPanel(m_key, p_nodePK));
            m_systemNodeValueDisplay = new SystemNodeValueDisplay(StatelessRemoteClientSessionUtil.getSession().getNodeValue(m_key, p_nodePK));
            jPanel3.add(m_systemNodeValueDisplay, java.awt.BorderLayout.NORTH);
        }
        catch(PermissionDeniedException e) {
            JOptionPane.showMessageDialog(this, "Permission denied!", "View Syatem Node", JOptionPane.WARNING_MESSAGE);
        }
        catch(Exception e) {
            ExceptionWindow.showError(e);
        }
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();

        setLayout(new java.awt.BorderLayout());

        jPanel3.setLayout(new java.awt.BorderLayout());

        jTabbedPane1.addTab("System Node", jPanel3);

        add(jTabbedPane1, java.awt.BorderLayout.CENTER);

    }//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTabbedPane jTabbedPane1;
    // End of variables declaration//GEN-END:variables
    
}
